﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/face.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<PhotoGallery.Entities.Category>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Gallery
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Main Page</h2>

<%var column=1; %>

<% for (var i = 0; i < Model.Count(); i++)
 { %>
    <% if (i < 2) {column = i;} else column = i%3;  %>
    <div class="wrapper">
    

<% if (((PhotoGallery.Entities.Category)Model.ElementAt(i)).CategoryImage != null)
   { %>

    <%if (column == 0) { %> <div class="left0"> <% } %>
    <%if (column == 1) { %> <div class="left1"> <% } %>
    <%if (column == 2) { %> <div class="left2"> <% } %>
    <h2> <%= ((PhotoGallery.Entities.Category)Model.ElementAt(i)).Name%>  </h2>
         <div class="smallimage">
         <img src="<%= Url.Action("GetCategoryImage", "Home", new { ((PhotoGallery.Entities.Category)Model.ElementAt(i)).CategoryId })%>"/></div> 
        </div>
        <% } %>

   


<% } %>
</div>       

</asp:Content>
